package com.project.oauth2Server.config;

import com.fasterxml.jackson.databind.ser.std.DateSerializer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.text.SimpleDateFormat;
import java.util.Date;

//@Configuration
//public class DateSerializerConfig {
//
//    @Value("${spring.jackson.date-format:yyyy-MM-dd HH:mm:ss}")
//    private String pattern;
//
//    @Bean
//    public DateSerializer dateSerializer() {
//        SimpleDateFormat formatter = new SimpleDateFormat(pattern);
//        return new DateSerializer(true, formatter);
//    }
//
//    @Bean
//    public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
//        return b -> b.serializerByType(Date.class, dateSerializer());
//    }
//
//}
